<table class="layui-table" style="width:2500px;" id="contentTab">
 	<input type="hidden" id="billid" th:value="${purchaseInquiry.id}"/>
 	<input type="hidden" id="billno" th:value="${purchaseInquiry.billNo}"/>
 	<input type="hidden" id="companyid" th:value="${purchaseInquiry.companyid}"/>
 	<!-- <input type="hidden" id="companyid" th:value="${purchaseInquiry.orderNo}"/> -->
 	<input type="hidden" id="supplierid" th:value="${purchaseInquiry.supplierid}"/>
  <thead>
    <tr>
    	 <th><input type="checkBox" lay-skin="primary" name="headCheckBox" lay-filter="headCheckBox"/></th>
		 <th type="display:none" data-field="billId">询价单ID</th>
		 <th data-field="billNo">询价单编号</th>
		 <th data-field="materialCode">物料编码</th>
		 <th data-field="materialName">物料名称</th>
		 <th data-field="materialSpec">物料规格</th>
		 <th data-field="materialType">物料类型</th>
		 <th data-field="brand">品牌</th>
		 <th data-field="measurementUnit">计量单位</th>
		 <th data-field="supplierMaterialCode">供应商物料编码</th>
		 <th data-field="supplierMaterialName">供应商物料名称</th>
		 <th data-field="supplierMaterialSpec">供应商物料规格</th>
		 <th data-field="price">单价</th>
		 <th data-field="taxRate">税率%</th>
		 <th data-field="taxPrice">含税价格</th>
		 <th data-field="effectialTime">生效日期</th>
		 <th data-field="amount">预计采购量</th>
		 <th data-field="deliveryTime">预计交付日期</th>
		 <th data-field="effectialType">生效规则</th>
    </tr>
     </thead>
    <tbody>
   
    <tr th:each="item : ${details}" class="edittr">
    	<td style="width:40px;"><input type="checkBox" lay-skin="primary" name="trCheckBox"/></td>
		<td style="width:100px;"><input type="hidden" name="id" th:value="${item.id}"/><span th:text="${item.billId}"></span></td>
		<td style="width:100px;"><input type="text" name="billNo" th:value="${item.billNo}"/><span th:text="${item.billNo}"></span></td>
		<td style="width:150px;padding-left:0px;padding-right:0px;">
			<input type="text" name="materialCode" class="layui-input" style="width:150px;" th:value="${item.materialCode}"/>
			<input type="hidden" name="materialId" class="layui-input" style="width:150px;" th:value="${item.materialId}"/>
		</td>
		<td name='name' style="background-color:#f3f2f2;width:200px;" th:text="${item.materialName}"></td>
		<td name='spec' style="background-color:#f3f2f2;width:200px;" th:text="${item.materialSpec}"></td>
		<td name="type" style="background-color:#f3f2f2" th:text="${item.materialType}"></td>
		<td name="brand" style="background-color:#f3f2f2" th:text="${item.brand}"></td>
		<td name="measureUnit" style="background-color:#f3f2f2" th:text="${item.measurementUnit}"></td>
		<td name="sup_code" style="background-color:#f3f2f2" th:text="${item.supplierMaterialCode}"></td>
		<td name="sup_name" style="background-color:#f3f2f2" th:text="${item.supplierMaterialName}"></td>
		<td name="sup_spec" style="background-color:#f3f2f2" th:text="${item.supplierMaterialSpec}"></td>
		<td style="padding-left:0px;padding-right:0px;width:80px;"><input style="width:80px;" type="text" name="price" required  lay-verify="required|number" placeholder="单价" autocomplete="off" class="layui-input" th:value="${item.price}"/></td>
		<td name="taxRate" style="background-color:#f3f2f2"><span th:text="${item.taxRate}"></span></td>
		<td name="taxPrice" style="background-color:#f3f2f2"><span th:text="${item.taxPrice}"></span></td>
		<td><span th:text="${#dates.format(item.effectialTime, 'yyyy-MM-dd HH:mm:ss')}"></span></td>
		<td style="padding-left:0px;padding-right:0px;width:120px;"><input style="width:120px;" type="text" name="amount" required  lay-verify="required|number" placeholder="预计采购量" autocomplete="off" class="layui-input" th:value="${item.amount}"/></td>
		<td><span th:text="${#dates.format(item.deliveryTime, 'yyyy-MM-dd HH:mm:ss')}"></span></td>
		<td name="effectialType" style="background-color:#f3f2f2;width:160px;">
			<select lay-filter="effectialType" name="effectialType">
				<option value="">请选择生效规则</option>	
				<option th:each="s :${effectialType}" th:value="${s.code}" th:text="${s.value}" th:selected="${item.effectialType==s.code}"></option>
			</select>
		</td>
	</tr>
	</tbody>
</table>
<table style="display:none;" id="blankTpl">
<tbody>
<tr class="edittr">
		<td style="width:40px;"><input type="checkBox" lay-skin="primary" name="trCheckBox" lay-filter="trCheckBox"/></td>
		<td style="width:50px"><input type="hidden" name="id" value=""/><span th:text="${purchaseInquiry.id}"></span></td>
		<td style="width:50px"><input type="hidden" name="billNo" value=""/><span th:text="${purchaseInquiry.billNo}"></span></td>
		<td style="width:100px;padding-left:0px;padding-right:0px;">
			<input type="text" name="materialCode" class="layui-input" style="width:150px;" value=""/>
			<input type="hidden" name="materialId" class="layui-input" style="width:150px;" value=""/>
		</td>
		<td name='name' style="background-color:#f3f2f2;width:200px;"><span></span></td>
		<td name='spec' style="background-color:#f3f2f2;width:200px;"></td>
		<td name="type" style="background-color:#f3f2f2"></td>
		<td name="brand" style="background-color:#f3f2f2"></td>
		<td name="measureUnit" style="background-color:#f3f2f2"></td>
		<td name="sup_code" style="background-color:#f3f2f2"></td>
		<td name="sup_name" style="background-color:#f3f2f2"></td>
		<td name="sup_spec" style="background-color:#f3f2f2"></td>
		<td style="padding-left:0px;padding-right:0px;width:80px;"><input style="width:80px;" type="text" name="price" required  lay-verify="required|number" placeholder="单价" autocomplete="off" class="layui-input"></td>
		<td name="taxRate" style="background-color:#f3f2f2"><span></span></td>
		<td name="taxPrice" style="background-color:#f3f2f2"><span></span></td>
		<td name="effectialTime" type="text"></td>
		<td style="padding-left:0px;padding-right:0px;width:120px;"><input style="width:120px;" type="text" name="amount" required  lay-verify="required|number" placeholder="预计采购量" autocomplete="off" class="layui-input"></td>
		<td name="deliveryTime" type="text"></td>
		<td name="effectialType" style="background-color:#f3f2f2;width:160px;">
			<select lay-filter="effectialType" name="effectialType">
				<option value="">请选择生效规则</option>	
				<option th:each="s:${effectialType}" th:value="${s.code}" th:text="${s.value}"></option>
			</select>
		</td>
	</tr>
	</tbody>
</table>
<script th:inline="javascript">
layui.use("laydate",function(){
	var laydate = layui.laydate;
	laydate.render({
		  elem: '#effectialTime' //指定元素
		});
	laydate.render({
		  elem: '#deliveryTime' //指定元素
		});
});
</script>